<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("contents") != null ? request.getParameter("contents") : "";
%>
<%
String path = request.getContextPath();
//String basePath = "http://localhost:8080/wechatEnterprise/";
%>
	<link rel="stylesheet" href="<%=path%>/editor/themes/default/default.css" />
	<link rel="stylesheet" href="<%=path%>/editor/plugins/code/prettify.css" />
	<script charset="utf-8" src="<%=path%>/editor/kindeditor.js"></script>
	<script charset="utf-8" src="<%=path%>/editor/lang/zhCN.js"></script>
	<script charset="utf-8" src="<%=path%>/editor/plugins/code/prettify.js"></script>
	<script>
		 KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '<%=path%>/editor/plugins/code/prettify.css',
				uploadJson : '<%=path%>/Upload/image',
				fileManagerJson : '../jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();//这样应该是subim提交时执行的
						document.forms['example'].submit();
					});
				},
				afterBlur : function() {
					this.sync();//修改的，失去焦点后执行
				}
			});
			prettyPrint();
		});
	</script>
	<script>
		 KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="econtent"]', {
				cssPath : '<%=path%>/editor/plugins/code/prettify.css',
				uploadJson : '<%=path%>/Upload/image',
				fileManagerJson : '../jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();//这样应该是subim提交时执行的
						document.forms['example'].submit();
					});
				},
				afterBlur : function() {
					this.sync();//修改的，失去焦点后执行
				}
			});
			prettyPrint();
		});
	</script>
	<!-- <form name="example" method="post" action="demo.jsp"> -->
		
		<br />
		<!-- <input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter) -->
	<!-- </form> -->
<%!
 private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
} 
%>
